home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1984 July to December / Ahoy_Magazine_84-Jul-Dec_1984_Double_L_unofficial.d64 / lunar lander (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  5KB  |  164 lines

  1. 5 rem dec. 19, 1983
  2. 6 poke 53280,8:poke53281,0
  3. 10 print"[147]             lunar lander"
  4. 20 print"          (c) copyright 1983"
  5. 30 print"            by anthony wood"
  6. 50 poke55,248:poke56,157:rem 40440
  7. 60 clr:s=54272
  8. 100 v=53248:s1=64*13:s2=64*14:s3=64*15:k=2040:sr=40444
  9. 110 forz=0to39:reada:poke40456+z,a
  10. 120 pokes2+z,a:pokes3+z,a:next
  11. 130 for z=40to62:reada:poke40456+z,a:next
  12. 132 forz=40to62:reada:pokes2+z,a:next
  13. 134 forz=40to62:reada:pokes3+z,a:next
  14. 135 forz=1to63*3:reada:poke40518+z,a:next
  15. 137 forz=0to13:reada:poke40441+z,a:next
  16. 138 sys40441
  17. 139 fu=5000:f2=0:l1=0:l2=0:sc=0:gosub700
  18. 140 gosub900:pokev+39,1:pokek,13:pokev,0:pokev+1,0:pokev+21,1
  19. 150 h=15:e=5:x=30+int(rnd(0)*100):y=30:f(0)=13:f(1)=13:f(2)=14
  20. 160 f(3)=15:m=1
  21. 200 j=peek(56320):p=peek(197):iffu=0thenb=0:m=1:pokes+1,0:goto220
  22. 210 ifp=60or(jand16)=0thenb=b+1:goto213
  23. 211 b=0:m=1:pokes+4,0
  24. 213 ifm<>1thenpokes+4,129
  25. 215 if p=7or(jand4)=0thenh=h-1:print"<<":fu=fu-1
  26. 216 if p=2or(jand8)=0thenh=h+1:print">>":fu=fu-1
  27. 220 gosub760:ifb=6orb=1thenm=m+1
  28. 240 e=e+gr-m*1.65:fu=fu-(m-1)*10:iffu<0thenfu=0
  29. 245 x=x+int(h/6):y=y+int(e/5)
  30. 250 ifx<5thenx=5
  31. 252 ify>251theny=252:gosub800:y=35:x=29:fu=5000:f2=1:gosub5000
  32. 255 ify<35theny=35:e=3
  33. 256 ifx>319thenx=319
  34. 260 pokek,13:z=peek(v+31):gosub800
  35. 266 ifpeek(v+31)<>0then300
  36. 270 pokek,f(m-fl):iffl=0thenfl=1:goto200
  37. 280 fl=0:goto200
  38. 300 iff2=1then440
  39. 310 ify<149then270
  40. 320 ify<227 orx<099or x>123 ore>9orabs(h)>10then330
  41. 322 if l1=1andl2=1then330
  42. 325 y=227:gosub800:sc=sc+100:l2=1
  43. 327 goto400
  44. 330 ify<177 orx<197 orx>203 ore>9 orabs(h)>10then340
  45. 335 y=179:gosub800:sc=sc+500:l1=1:goto400
  46. 340 pokes+4,129:v2=11:pokesr,63+8:sys40441:gosub820:pokesr,126+8:sys40441
  47. 350 gosub840:pokesr,189+8:sys40441:gosub840:pokes+4,0:pokes+24,15:pokes+1,2
  48. 360 pokev+21,0:pokesr,8:sys40441:goto410
  49. 400 pokes+4,0:gosub750:print" landed!!"
  50. 410 geta$:ifa$<>"[136]"then410
  51. 415 pokev+21,0:print"         "
  52. 420 iffu=0then 460
  53. 425 iff2=1theny=10:x=29:e=5:h=0:gosub5000:pokev,x:pokev+1,y:pokev+21,1:goto160
  54. 435 goto140
  55. 440 ifx<230orx>242ory<121ory>130ore>9orabs(h)>11then340                    
  56. 450 f2=0:sc=sc+1000:l1=0:l2=0:fu=4500:goto400
  57. 460 print"[147]":print:print"do you want to play again?"
  58. 470 geta$:ifa$=""then470
  59. 480 ifa$="y"then139
  60. 490 ifa$<>"n"then470
  61. 500 pokes+4,0:print"[147]":end
  62. 700 print:print:print"  enter gravity strength (1[146],2[146], or 3[146])"
  63. 701 pokes+5,129:pokes+6,216:pokes+24,15          .
  64. 702 pokes,200:pokes+4,0:pokes+1,2
  65. 710 geta$:ifa$=""then710
  66. 715 ifa$="1"thengr=3:return
  67. 720 ifa$="2"thengr=3.6:return
  68. 730 ifa$="3"thengr=4.25:return
  69. 740 goto710
  70. 750 print"score";sc;
  71. 760 print"  ";tab(28);"fuel     [157][157][157][157][157]";fu;:return
  72. 800 pokev+1,y:ifx<256thenpokev,x:pokev+16,0:return
  73. 810 pokev,x-256:poke53264,127:return
  74. 820 pokes+1,3:forx=1to4:pokes+24,v2:fory=1to15:next:v2=v2+1
  75. 830 next:return
  76. 840 forx=1to7:pokes+24,v2:fory=1to9:next:v2=v2-1:next:return
  77. 900 print"[147]":gosub750:print:fory=0to9:a=rnd(0)
  78. 910 ifa>.3thenprinttab(rnd(0)*39);"."
  79. 920 if a<=.3thenprint
  80. 930 next:print:print:print
  81. 1000 print"                              [169][223][146]    "
  82. 1100 print"                             [169]  [223][146]     "
  83. 1200 print"                           [169]      [223][146]   "
  84. 1300 print"                         [169]         [223][146]  "
  85. 1400 print"                     [169]              [146] "
  86. 1500 print"                    [169] 500           [223][146]"
  87. 1600 print"     [169] [223][146]           [169]                 [146] "
  88. 1700 print"    [169]   [146]         [169]                   [223][146] "
  89. 1800 print"  [169]     [223][146]       [169]                     [146] "
  90. 1900 print" [169]       [223][146]     [169]                      [223][146]"
  91. 1910 print"           100                         [146]";
  92. 1920 ifl2=1andl1=1thenprint"[223][146]   [169][146]";
  93. 1930 return
  94. 1999 rem lander sprites
  95. 2000 data 0,255,0,0,255,0,7,255,224,7
  96. 2010 data 255,224,7,255,224,0,255,0,0,255
  97. 2020 data 0,15,255,240,15,255,240,15,255,240
  98. 2030 data 3,255,192,3,60,192,6,126,96,12
  99. 2040 rem no flame
  100. 2050 data 0,48,24,0,24,0,0,0,0,0
  101. 2060 data 0,0,0,0,0,0,0,0,0,0,0,0,0
  102. 2070 rem small flame
  103. 2080 data 0,48,24,60,24,0,102,0,0,60
  104. 2090 data 0,0,24,0,0,24,0,0,0,0,0,0,0
  105. 2100 rem  big flame
  106. 2110 data 0,48,24,126,24,0,219,0,0,219
  107. 2120 data 0,0,102,0,0,60,0,0,24,0,0,24,0
  108. 2130 rem explosion
  109. 2140 data 0,0,0,0,0,0,0,0
  110. 2150 data 0,0,0,0,0,0,0,0
  111. 2160 data 64,0,6,72,0,0,24,0
  112. 2170 data 12,224,0,0,228,0,0,0
  113. 2180 data 0,13,80,0,0,0,0,0
  114. 2190 data 0,0,0,0,0,0,0,0,0,0,0,0,0
  115. 2200 data 0,0,0,0,0,0,0,0,0,0
  116. 2210 rem frame 2 of explosion
  117. 2220 data 0,0,0,0,0,0,0,0
  118. 2230 data 0,0,128,0,24,131,0,24
  119. 2240 data 3,0,0,0,0,0,0,0
  120. 2250 data 48,224,0,48,227,0,0,0
  121. 2260 data 0,0,0,0,28,0,0,24
  122. 2270 data 152,0,2,8,0,0,64,0
  123. 2280 data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  124. 2290 rem frame 3 of explosion
  125. 2300 data 0,0,0,0,0,0,0,0
  126. 2310 data 0,0,128,128,24,129,0,24
  127. 2320 data 0,0,0,0,0,0,0,0
  128. 2330 data 64,0,0,64,0,112,0,0
  129. 2340 data 0,0,0,0,32,0,208,32
  130. 2350 data 0,0,0,0,0,0,2,0
  131. 2360 data 4,65,0,4,64,128,0,0
  132. 2370 data 0,0,0,0,0,0,0
  133. 2380 rem block move
  134. 2390 data 162,0,189,8,158,157,64,3,232
  135. 2400 data 224,63,208,245,96
  136. 4999 rem draw cave
  137. 5000 print"[147]":gosub750:print:pokes+4,0:pokes+1,2
  138. 5005 print"                                       "
  139. 5010 print"                                       "
  140. 5020 print"                                       "
  141. 5030 print"                                       "
  142. 5040 print"                                       "
  143. 5050 print"                         [146][169]  [223][169] [223] [146][169]  [223]  "
  144. 5060 print"                         [146]              "
  145. 5065 print"                         [146]              "
  146. 5070 print"                         [146]              "
  147. 5080 print"                         [146] [175][175][175][175]        "
  148. 5090 print"                                  [146]     "
  149. 5100 print"                          1000   [146][169]     "
  150. 5200 print"                                [146][169]      "
  151. 5210 print"                               [146][169]       "
  152. 5220 print"                              [146][169]        "
  153. 5230 print"     [223][169][223][169][223][169][223][169][223]  [146][169][223]  [146][169][223][169][223]  [146][169][223][169]          "
  154. 5240 print"              [223][169]                     [169] [146]"
  155. 5250 print"                                    [169]  [146]"
  156. 5260 print"                                   [169]   [146]"
  157. 5270 print"                                 [169]     [146]"
  158. 5280 print"                               [169]       [146]"
  159. 5285 print"              [169][223][146]                       [146]"
  160. 5290 print"                                       [146]"
  161. 5295 print"                                       [146]";
  162. 5300 print"";tab(38);" [157] [157] [157] [157] [157] [157] [157] [157] [157] [157] [157] [157] [157] [157] [157] [146]";
  163. 6000 return
  164.